From 8cf1f5455e404e817129adac073c91b1d96c413b Mon Sep 17 00:00:00 2001 From: "cl349@freefall.cl.cam.ac.uk" Date: Fri, 27 Aug 2004 18:21:51 +0000 Subject: [PATCH] bitkeeper revision 1.1159.63.1 (412f7bbf5smbnLknRPslkbedgaBzzw) Only update the tls descriptors if they are changed. --- .../arch/xen/i386/kernel/process.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/linux-2.6.8.1-xen-sparse/arch/xen/i386/kernel/process.c b/linux-2.6.8.1-xen-sparse/arch/xen/i386/kernel/process.c index 11cba27734..75816caf32 100644 --- a/linux-2.6.8.1-xen-sparse/arch/xen/i386/kernel/process.c +++ b/linux-2.6.8.1-xen-sparse/arch/xen/i386/kernel/process.c @@ -556,7 +556,15 @@ struct task_struct fastcall * __switch_to(struct task_struct *prev_p, struct tas * Load the per-thread Thread-Local Storage descriptor. * This is load_TLS(next, cpu) with multicalls. */ -#define C(i) queue_multicall3(__HYPERVISOR_update_descriptor, virt_to_machine(&get_cpu_gdt_table(cpu)[GDT_ENTRY_TLS_MIN + i]), ((u32 *)&next->tls_array[i])[0], ((u32 *)&next->tls_array[i])[1]) +#define C(i) do { \ + if (unlikely(next->tls_array[i].a != prev->tls_array[i].a || \ + next->tls_array[i].b != prev->tls_array[i].b)) \ + queue_multicall3(__HYPERVISOR_update_descriptor, \ + virt_to_machine(&get_cpu_gdt_table(cpu) \ + [GDT_ENTRY_TLS_MIN + i]), \ + ((u32 *)&next->tls_array[i])[0], \ + ((u32 *)&next->tls_array[i])[1]); \ +} while (0) C(0); C(1); C(2); #undef C -- 2.30.2